/**
 * author wen
 * &copy; CUNYU GROUP
 * email wjd_13@hotmail.com
 */
package com.cunyu.service;

import cn.tom.db.jdbc.simple.DBUtil;
import com.cunyu.util.JPushUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * 极光推送 数据
 * @author win
 * 2019/05/15-16:32
 */
@Service
public class PushService extends BaseService{

    Logger logger = LoggerFactory.getLogger(PushService.class) ;

    public void push(String title,String msg ,int uid){
        /*try {
            //String str = JPushUtil.pushByid(msg, "default",  new String[]{"'"+uid+"'"});
            System.out.println(str);
        }catch (Exception e){
            logger.error("推送错误",e);
            logger.info(uid+" : msg : "+msg);
        }*/
        exec("insert into pushmsg(uid, title, content) values(?,?,?)", uid, title, msg);
        JPushUtil.pushMsg(uid,title,msg);
    }

}
